package com.ajavaer.framework.handle;

import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisCommands;

import java.util.List;
import java.util.Map;
import java.util.Set;

public interface RedisHandle extends CacheHandle<String, String> {

    void close(JedisCommands jedis);

    Jedis jedis();

    void expire(String key, int time);

    void hincrBy(String key, String field, int count);

    boolean exists(String key);

    boolean hexists(String key, String field);

    Long decr(String key);

    Long incr(String key);

    Long del(String key);

    void del(byte[] key);

    Set<byte[]> keys(String prefix);

    void put(byte[] key, byte[] value);

    byte[] getIfPresent(byte[] key);

    void hset(String key, String field, String value);

    void hset(String key, String field, String value, int expire);

    String hget(String key, String field);

    Map<String, String> hgetAll(String key);

    void hsetAll(String key, Map<String, String> value, int expire);

    void hsetAll(String key, Map<String, String> value);

    List<String> hvals(String key);
}
